<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui">

<!-- INTERFACE -->
<composite:interface displayName="Barra">
	<composite:attribute name="bean" required="true" />
	<composite:attribute default="true" name="renderedNuevo" />
	<composite:attribute default="true" name="renderedEditar" />
	<composite:attribute default="true" name="renderedGuardar" />
	<composite:attribute default="true" name="renderedCancelar" />
</composite:interface>

<!-- IMPLEMENTATION -->
<composite:implementation>

	<p:toolbar>
		<p:toolbarGroup align="left">

			<p:commandButton value="Nuevo" action="#{cc.attrs.bean.crear}" process="@this" update=":form:panelContenedor"
				disabled="#{cc.attrs.bean.editado}" icon="ui-icon-document" partialSubmit="true" rendered="#{cc.attrs.renderedNuevo}">
			</p:commandButton>

			<p:commandButton value="Editar" action="#{cc.attrs.bean.editar}" process="@this,:form:panelListado" update=":form:panelContenedor"
				disabled="#{cc.attrs.bean.editado}" icon="ui-icon ui-icon-pencil" partialSubmit="true" rendered="#{cc.attrs.renderedEditar}">
			</p:commandButton>

			<p:commandButton value="Guardar" action="#{cc.attrs.bean.guardar}" process="@this,:form:panelNuevo" update="@this,:form:panelContenedor"
				disabled="#{!cc.attrs.bean.editado}" icon="ui-icon-disk" partialSubmit="true" rendered="#{cc.attrs.renderedGuardar}">
			</p:commandButton>

			<p:commandButton value="Cancelar" action="#{cc.attrs.bean.cancelar}" process="@this" update=":form:panelContenedor"
				disabled="#{!cc.attrs.bean.editado}" icon="ui-icon-arrowreturnthick-1-w" partialSubmit="true" rendered="#{cc.attrs.renderedCancelar}">
			</p:commandButton>

			<composite:insertChildren />

		</p:toolbarGroup>
	</p:toolbar>

	<p:spacer width="5px" />

</composite:implementation>


</html>